﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CastleOfTheDisillusioned {
	class ParticleManager {
		static List<Particle> Particles = new List<Particle>();

		public static void Track(Particle p) {
			Particles.Add(p);
		}

		public static void Update() {
			for (int i = 0; i < Particles.Count; i++) {
				Particle p = Particles[i];
				p.Update();
				if (p.IsDead) {
					Particles.Remove(p);
					i--;
				}
			}
		}

		public static void Draw() {
			foreach (Particle p in Particles) {
				p.Draw();
			}
		}
	}
}
